package com.chen.androidstudy.utils

import com.base.library.coroutine.mainSupervisor
import com.chen.androidstudy.App
import com.tencent.bugly.crashreport.CrashReport

/**
 * 自定义catch的错误上报bugly
 */
fun Throwable.postBugly() {
    val t = this
    mainSupervisor {
        CrashReport.setUserId("123")
        CrashReport.putUserData(App.instance, "staffName", "name")
        CrashReport.putUserData(App.instance, "token", "")
        CrashReport.postCatchedException(t)
    }
}